// 评论功能请求模块

import request from '@/utils/request'

// 获取所有的评论列表
export const getCommentsList = params => {
  return request({
    method: 'GET',
    url: '/app/v1_0/comments',
    params
  })
}

// 点赞评论
export const addCommentLike = targetId => {
  return request({
    method: 'POST',
    url: '/app/v1_0/comment/likings',
    data: {
      target: targetId
    }
  })
}

// 取消点赞
export const deleteCommentLike = targetId => {
  return request({
    method: 'DELETE',
    url: '/app/v1_0/comment/likings/' + targetId
  })
}

// 添加评论或评论回复
export const addComment = data => {
  return request({
    method: 'POST',
    url: '/app/v1_0/comments',
    data
  })
}
